<?php require_once('../session/auth.php'); ?>
<?php include '../config/config.php'; ?>
<!DOCTYPE html>
<html>
	<head>
		<title><?php echo FOOTERPAGE; ?></title>
		<link href="../style.css" rel="stylesheet" type="text/css" media="screen" />
		<script src="../js/jquery-1.10.0.min.js"></script>
		<script>
		$(document).ready(function(){

			$('body').on('click', '.btn', function(){
				var footertitle1_val = $('.footertitle1').val();
				var footercontent1_val = $('.footercontent1').val();
			
			 if(footertitle1_val != "" && footercontent1_val != "" ) {
					$.ajax({
						type:'POST',
						url:'processfooter.php',
						data:{action: "updateInsert", value1:footertitle1_val, value2:footercontent1_val},
						success: function(data){
							alert('success');
							homepage();
						}
					});
				}

			});
				function homepage()
  				{
	  				setTimeout(function(){
	  					window.location.assign('http://localhost/simple/')
	  				},1000);
  				}

		});
		</script>
	</head>
	<body>	
		<?php

			$sql = "SELECT * FROM footer1";
			$r = mysql_query($sql);
			$rows = mysql_fetch_array($r);
			$result=mysql_query($sql);
		?>
		<div class="cont">
			<h1 style="text-align:center; color:#FFF;"><?php echo FOOTERPAGE; ?></h1>
				<p>Footer Title</p>
				<input type="text" name="Footertitle" class="footertitle1" value="<?php echo $rows['footertitle1'];?>">			
				<p>Footer Content</p>
				<textarea name="content" class="footercontent1" style="height:130px;"><?php echo $rows['footercontent1'];?></textarea>
				<div class="btn">Update</div>
		</div>
	
	</body>
</html>
